public class Person {
    private String name;
    public int age;
    public Person(){
        System.out.println("无参方法");
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("带参数的方法");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void sleep(){
        System.out.println(this.name+"正在睡觉!");
    }
}
